package rubik.crossover;

import rubik.CubeSolution;
import rubik.ICubeSolution;

public class ConcatenationCrossOver extends AbstractCrossOver{

	@Override
	public ICubeSolution applyCrossOver(ICubeSolution firstParent,
			ICubeSolution secondParent) {
		
		CubeSolution newSeq = new CubeSolution(firstParent.getCube(), firstParent.getSeqGenerator(), firstParent.getMutator(), firstParent.getFitnessFunc(), firstParent.getCrossoverFunc());
		for (int i = 0; i < firstParent.getSeqs().size(); i++) {
			newSeq.getSeqs().add(firstParent.getSeqs().get(i));
		}
		for (int i = 0; i < secondParent.getSeqs().size(); i++) {
			newSeq.getSeqs().add(secondParent.getSeqs().get(i));
		}
	return newSeq;
	}

}
